/**
 * 附件，入库情况
 */
import React from 'react';
import { Form, Button } from 'antd';
import { withRouter } from 'umi';
import FileUpload from '@/components/Custom/FileUpload';
import { FormHeader, FormLayout } from '../../components';
import FieldReadOnly from './FieldReadOnly';

function ResumeOther({ form, location }) {
    const { query } = location;
    const { id } = query;
    const { getFieldDecorator } = form;
    return (
        <>
            <FormHeader title="附件" id="resume-annex" />
            <FormLayout type="full">
                <Form.Item
                    label="附件"
                    help="支持 pdf、doc、xls、docx、pptx、jpg、jpeg、png、txt 等格式的附件，单个文件大小为10MB以内"
                >
                    {getFieldDecorator('resumeAttachmentList')(
                        <FileUpload categoryCode="resumeAttachmentList" checkFileSize={10}>
                            <Button>添加附件</Button>
                        </FileUpload>
                    )}
                </Form.Item>
            </FormLayout>

            {id && (
                <>
                    <FormHeader title="入库情况" id="resume-other" />
                    <FormLayout type="col2">
                        <FieldReadOnly label="入库时间" field="createTime" form={form} />
                    </FormLayout>
                </>
            )}
        </>
    );
}

export default withRouter(ResumeOther);
